package RandomCircles;


import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

/**
 *  When run as a program, this class opens a window on the screen that
 *  shows a large number of colored disks.  The positions of the disks
 *  are selected at random, and the color is randomly selected from
 *  red, green, or blue.  A black outline is drawn around each disk.
 *  The picture changes every three seconds.
 */
public class RandomCircles {  
    private static DrawCircles drawingArea;
    
    public static void main(String[] args) {
        
        /* NOTE:  The string in the following statement goes in the title bar
         * of the window.
         */
        JFrame window = new JFrame("Random Disks");
        /*
         * NOTE: If you change the name of this class, you must change
         * the name of the class in the next line to match!
         */
       drawingArea = new DrawCircles();

      // drawingArea.setBackground(Color.WHITE);
       window.setContentPane(drawingArea);

       /* NOTE:  In the next line, the numbers 500 and 500 give the
        * initial width and height of the drawing array.  You can change
        * these numbers to get a different size.
        */
       drawingArea.setPreferredSize(new Dimension(500,500));

       window.pack();
       window.setLocation(100,50);
       window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       
       
       /*
        * Note:  In the following line, you can change false to
        * true.  This will prevent the user from resizing the window,
        * so you can be sure that the size of the drawing area will
        * not change.  It can be easier to draw the frames if you know
        * the size.
        */
       window.setResizable(false);
       
       /* NOTE:  In the next line, the number 3000 gives the time between
        * calls to drawFrame().  The time is given in milliseconds, where
        * one second equals 1000 milliseconds.  You can change the number
        * to control the animation speed.
        */
       Timer frameTimer = new Timer(3000,drawingArea);

       window.setVisible(true);
       frameTimer.start();

    } // end main


    
  

}
